<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>注册页面</title>
    <link rel="stylesheet" href="../style/css/reg.css">
</head>

<body>
    <header>
        <div id="box">
            <span> <img src="../assets/images/HUAWEI.svg" class="adHeadPic"
                    style="height: 24px;width:108px;margin-top: 0px;">
            </span>
            <span><a href="index.html">华为商城</a> </span>
        </div>
    </header>
    <section>
        <h2>用户注册</h2>
        <div id="infor">
            <form id="login">
                <div class="regbox">
                    <p class="username">
                        <label>用户名：</label>
                        <input type="text" name="username" id="newUser">
                    </p>
                    <p class="phonenum">
                        <label for="newUser">手机号：</label>
                        <input type="text" id="phone">
                    </p>
                    <p class="password">
                        <label>密码：</label>
                        <input type="password" name="password" id="password">
                    </p>
                    <p class="passwordtwo">
                        <label for="checkPassword">确认密码：</label>
                        <input type="password" id="checkPassword">
                    </p>
                </div>
                <p class="know">
                    <span>
                        <input type="checkbox" id="confirm">
                        <label for="confirm">我已阅读注册相关条例</label>

                    </span>
                    <span>已有账号？<a href="logIn.html" id="href">点击登录</a></span>
                </p>

                <button id="regbtn">注册</button>
            </form>
        </div>
    </section>
    <footer>
        <div id="footer">
            <p>
                <img src="../assets/images/footlogo.png" alt="">
            </p>
            <p>
            <ul>
                <li>隐私声明 服务协议 COOKIES Copyright © 2012-2021 华为终端有限公司 版权所有 粤ICP备19015064号|粤公网安备 44190002003939号</li>
                <li>增值电信业务经营许可证：粤B2-20190762|备案主体编号：44201919072182</li>
            </ul>
            </p>
        </div>
    </footer>
    <script src="../dist/js/jquery-3.5.1.min.js"></script>
    <script src="../dist/js/layer.js"></script>

    <script>
        $('#regbtn').click(function () {


            $.get('../loginform.php', $('#login').serialize(), 'json').then(res => {

                console.log(123)

            })


            return false  //取消默认设置
        })






    </script>

    <script>
        $('#regbtn').click(function () {



            $.post('../loginform1.php', $('#login').serialize(), null, 'json').then(res => {
                // alert(res.msg)
                layer.alert(res.msg, {}, function () {
                    layer.closeAll()
                    console.log('aaaa')


                    if (res.type == "success") {

                        self.location = '../0422/index.html';
                    }

                })
            })

            return false  //取消默认设置
        })

    </script>




</body>

</html>